#include<iostream>
#include"mysql.h"
#include<string>
#include<unistd.h>

using namespace std;
const string host="127.0.0.1";
const string user="lujiaming";
const string password="@Dikhm11472";
const string db=" Product_platform";
const unsigned int port = 33060;

int main()
{
    //输出版本   
	std::cout<<"version :"<<mysql_get_client_info()<<std::endl;
	
    MYSQL* my=mysql_init(nullptr);
    if(my==nullptr)
    {
        cerr<<"init mysql error"<<endl;
        return 1;
    }
    cout<<"mysql初始化完成"<<endl;
    if(mysql_real_connect(my,host.c_str(),user.c_str(),password.c_str(),
        db.c_str(),port,nullptr,0)==nullptr)
    {
        cerr<<"connect error"<<endl;
        return 2;
    }
    cout<<"hello"<<endl;
}